/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controllers;

import beans.SobreCosto;
import facade.ReporteFacade;
import java.sql.SQLException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import request.CostoRequest;
import request.ReporteCombustibleRequest;
import request.ReporteEstadoPedidoRequest;
import request.ReporteHoraExtraRequest;
import request.ReporteIncidenciaRequest;
import request.ReporteZonasRequest;
import request.SobreCostoRequest;
import response.ListCosto;
import response.ReporteCombustibleResponse;
import response.ReporteEstadoPedidoResponse;
import response.ReporteHoraExtraResponse;
import response.ReporteIncidenciaResponse;
import response.ReporteZonaResponse;

/**
 *
 * @author Ahmed
 */
@Controller
public class ReporteController {
    private static ReporteFacade reporteFacade = new ReporteFacade();
    @RequestMapping(value = "/reporteSobreCostos")
    public ModelAndView SistemaWeb(){
        return new ModelAndView("reporteSobreCostos");
    } 
    
  @RequestMapping(value = "/reporteCumplimiento")
    public ModelAndView SistemaWeb1(){
        return new ModelAndView("reporteCumplimiento");
  }   
  
  @RequestMapping(value= "/reporteSobreCostosJSON.htm", method = RequestMethod.POST)
    public @ResponseBody SobreCosto ReporteSobreCosto(@RequestBody SobreCostoRequest reporte){
        return reporteFacade.ReporteSobreCosto(reporte);
    }
  
  @RequestMapping(value="/reporteZonas")
  public ModelAndView ReporteZonas(){
      return new ModelAndView("reporteZonas");
  }

  @RequestMapping(value="/reporteHorasExtras")
  public ModelAndView ReporteHorasExtras(){
      return new ModelAndView("reporteHorasExtras");
  }
  
  @RequestMapping(value="/reporteEstadoPedidos")
  public ModelAndView ReporteEstadoPedidos(){
      return new ModelAndView("reporteEstadoPedidos");
  }
  
  @RequestMapping(value="/reporteCostoCombustible")
  public ModelAndView ReporteCostoCombustible(){
      return new ModelAndView("reporteCostoCombustible");
  }
  
  @RequestMapping(value="/reporteIncidencias")
  public ModelAndView ReporteIncidencia(){
      return new ModelAndView("reporteIncidencias");
  }
  
  @RequestMapping(value="/reporteIncidenciaJSON.htm",method=RequestMethod.POST)
  public @ResponseBody ReporteIncidenciaResponse ReporteIncidencia(@RequestBody ReporteIncidenciaRequest reporte) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{ 
      return reporteFacade.reporteIncidencia(reporte);
  }
  
  @RequestMapping(value="/reporteCostoCombustibleJSON.htm",method=RequestMethod.POST)
  public @ResponseBody ReporteCombustibleResponse ReporteCostoCombustible(@RequestBody ReporteCombustibleRequest reporte) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{ 
      return reporteFacade.reporteCombustible(reporte);
  }
  
  @RequestMapping(value="/reporteZonasJSON.htm",method = RequestMethod.POST)
  public @ResponseBody ReporteZonaResponse ReporteZonasJson(@RequestBody ReporteZonasRequest reporte) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{
      return reporteFacade.reporteZonas(reporte);
  }
  
  @RequestMapping(value="/reporteHorasExtrasJSON.htm",method = RequestMethod.POST)
  public @ResponseBody ReporteHoraExtraResponse ReporteHorasExtrasJson(@RequestBody ReporteHoraExtraRequest reporte) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{
      return reporteFacade.reporteHorasExtras(reporte);
  }
  
  @RequestMapping(value="/reporteEstadoPedidosJSON.htm",method = RequestMethod.POST)
  public @ResponseBody ReporteEstadoPedidoResponse ReporteEstadoPedidosJson(@RequestBody ReporteEstadoPedidoRequest reporte) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{
      return reporteFacade.reporteEstadoPedidos(reporte);
  }  
  
}
